# problem
compare_scalar_type if {
    3 > 1
    true > false
    "b" > "a"
    "b" > "ac"
    "ada" > "ac"
    "ba" > "b"
}
compare_array if { # behave like string
    ["b"] > ["a"]
    ["b"] > ["a","c"]
    ["a","d","a"] > ["a","c"]
    ["b","a"] > ["b"]
}
type_mismatch if {
    {1,2} > {"a":1}
    {"a":1} > [1,2]
    [1,2] > "a"
    "a" > 1
    1 > true
    true > null
} # set > object > array > string > number > boolean > null

# solution
allow if {
    is_number(input.access_level) # add type check
    input.access_level > 3
}
greater_than(left,right) := true if {
    validate_type(left,right)
    left > right
}
greater_than(left,right) := false if {
    validate_type(left,right)
    left <= right
}
validate_type(left,right) if {
    type_name(left) == type_name(right)
}
else := false
